package com.example.a10928.weifriend.ui.task_center

import android.net.Uri
import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import android.widget.ImageView
import com.example.a10928.weifriend.util.L
import com.hd.viewcapture.CaptureManager
import com.hd.viewcapture.ViewCapture
import com.previewlibrary.view.BasePhotoFragment

 class ImageShowFragment : BasePhotoFragment() {
    override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
        super.onViewCreated(view, savedInstanceState)
        ivDownload.setOnClickListener {
            ViewCapture.with(imageView).asJPG().setOnSaveResultListener(object : CaptureManager.OnSaveResultListener {
                override fun onSaveResult(isSaved: Boolean, path: String?, uri: Uri?) {
                    L.t("保存图片成功")
                }
            }).save();
        }
    }


    override fun onCreateView(inflater: LayoutInflater, container: ViewGroup?, savedInstanceState: Bundle?): View? {
        return inflater.inflate(com.previewlibrary.R.layout.fragment_image_photo_layout, container, false)
    }
}